﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no, maximum-scale=1.0" />
    <title>信息查询</title>
    <link rel="stylesheet" type="text/css" href="/css/common.css" />
    <link rel="stylesheet" type="text/css" href="/css/index.css" />
</head>

<body class="bg_ef">
    <div class="container">
        <div class="header">
            <div class="headbg"><a href="/page/ComplaintHandlingSearch.html" class="return"></a></div>
           
            <p>投诉举报信息</p>
        </div>
        <main>
            <div class="list-box">
                <div class="list_name">
                    <div class="list_img">
                        <img src="/image/qiye.png">
                    </div>
                    <span>基本情况</span>
                </div>
                <input type="hidden" id="Unid">
                <ul class="list-item">
                    <li>编号 <span id="Code"></span></li>
                    <li>被举报企业 <span id="EnterpriseName"></span></li>
                    <li>企业地址 <span id="EnterpriseAddress"></span></li>
                    <li>是否匿名<span id="IsNnonymity"></span></li>
                    <li id="ComplaintPersonLi">投诉举报人<span id="ComplaintPerson"></span></li>
                    <li>联系电话<span id="Phone"></span></li>
                    <li>投诉举报日期<span id="ComplaintDate"></span></li>
                    <li>内容<span id="ContentStr"></span></li>
                    <li>处理<span id="HandlingContentStr"></span></li>
                </ul>

                <div class="list_name">
                    <div class="list_img">
                        <img src="/image/qiye.png">
                    </div>
                    <span>评价信息</span>
                </div>
                <ul class="list-item" id="EvaluateUl1" style="display:none;">
                    <li>评价意见 <span id="EvaluateOpinion"></span></li>
                    <li>评价内容 <span id="EvaluateStr"></span></li>
                </ul>
                <ul class="list-item" id="EvaluateUl2">
                    <li>
                        评价意见 <input type="radio" name="EvaluateOpinion" value="满意" />满意
                        <input type="radio" name="EvaluateOpinion" value="不满意" />不满意
                    </li>
                    <li>评价内容 <input id="EvaluateStr2" /></li>
                    <li><button onclick="EvaluateSubmit()" class="am-btn am-btn-block am-btn-primary">提交</button></li>
                </ul>
            </div>
        </main>
    </div>
</body>

</html>
<script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script>
<script src="/static/usi/core.js"></script>
<script src="/static/usi/tools.js"></script>
<script>
    window.onload = function () {
        var code = unescape(jQuery.usi.core.getURLParam("Code"));
        jQuery.usi.core.get(ip + api + "/GetComplaintHandlingData", { code: code }, false, function (data) {
            if (data.data == null) {
                $("#Unid").html("");
                $("#Code").html("未知");
                $("#EnterpriseName").html("未知");
                $("#EnterpriseAddress").html("未知");
                $("#IsNnonymity").html("未知");
                $("#ComplaintPerson").html("未知");
                $("#Phone").html("未知");
                $("#ComplaintDate").html("未知");
                $("#ContentStr").html("未知");
                $("#HandlingContentStr").html("未知");
                $("#EvaluateOpinion").html("未知");
                $("#EvaluateStr").html("未知");
                $("#EvaluateUl1").show();
                $("#EvaluateUl2").hide();
            }
            else {
                $("#Unid").val(data.data.unid);
                $("#Code").html(jQuery.usi.core.isNullOrEmpty(data.data.code) ? "未知" : data.data.code);
                $("#EnterpriseName").html(jQuery.usi.core.isNullOrEmpty(data.data.enterpriseName) ? "未知" : data.data.enterpriseName);
                $("#EnterpriseAddress").html(jQuery.usi.core.isNullOrEmpty(data.data.enterpriseAddress) ? "未知" : data.data.enterpriseAddress);
                $("#IsNnonymity").html(jQuery.usi.core.isNullOrEmpty(data.data.isNnonymity) ? "未知" : data.data.isNnonymity);
                if (data.data.isNnonymity == "匿名")
                    $("#ComplaintPersonLi").hide();
                else
                    $("#ComplaintPerson").html(jQuery.usi.core.isNullOrEmpty(data.data.complaintPerson) ? "未知" : data.data.complaintPerson);
                $("#Phone").html(jQuery.usi.core.isNullOrEmpty(data.data.phone) ? "未知" : data.data.phone);
                $("#ComplaintDate").html(jQuery.usi.core.isNullOrEmpty(data.data.complaintDate) ? "未知" : jQuery.usi.core.formatDate(data.data.complaintDate));
                $("#ContentStr").html(jQuery.usi.core.isNullOrEmpty(data.data.contentStr) ? "未知" : data.data.contentStr);
                $("#HandlingContentStr").html(jQuery.usi.core.isNullOrEmpty(data.data.handlingContentStr) ? "未知" : data.data.handlingContentStr);
                $("#EvaluateOpinion").html(jQuery.usi.core.isNullOrEmpty(data.data.evaluateOpinion) ? "未知" : data.data.evaluateOpinion);
                $("#EvaluateStr").html(jQuery.usi.core.isNullOrEmpty(data.data.evaluateStr) ? "未知" : data.data.evaluateStr);
                if (!jQuery.usi.core.isNullOrEmpty(data.data.evaluateOpinion)) {
                    $("#EvaluateUl1").show();
                    $("#EvaluateUl2").hide();
                }
            }
        });
    }
    function EvaluateSubmit() {
        if (jQuery.usi.core.isNullOrEmpty($("input:radio[name='EvaluateOpinion']:checked").val())) {
            layer.alert("评价意见未选择");
            return;
        }
        var obj = {
            Unid:  $("#Unid").val() ,
            EvaluateOpinion: $("input:radio[name='EvaluateOpinion']:checked").val(),
            EvaluateStr: $("#EvaluateStr2").val()
        };
        jQuery.usi.core.post(ip + api + "/UpdateComplaintHandling", { "": jQuery.toJSON(obj) }, false, function (data) {
            if (data.success) {
                //alert("提交成功");
                //window.location.href = "/page/ComplaintHandlingSearch.html";
                layer.alert("提交成功");
                $("#EvaluateUl1").show();
                $("#EvaluateUl2").hide();
                $("#EvaluateOpinion").html(obj.EvaluateOpinion);
                $("#EvaluateStr").html(obj.EvaluateStr);
            }
        }, function (resultdata) {
            layer.alert("提交失败");
        });
    }
</script>